package it.com;

public class ArithmeticDemo {
    public static void main(String[] args) {
        int a = 10;
        int b = 20;
        a++;
        b--;
        System.out.println("a = " + a);
        System.out.println("b = " + b);


        //这里的++或者--如果是被使用，那么变量自身都会自增或者自减
        //++在前，首先赋值给变量
        int c = 5;
        int d = 5;
        int e = d++;
        int f = ++c;
        System.out.println(c);
        System.out.println(d);
        System.out.println(e);
        System.out.println(f);

        System.out.println("------------------");

        int c1 = 5;
        int d1 = 5;
        int e1 = d1--;
        int f1 = --c1;
        System.out.println(c1);
        System.out.println(d1);
        System.out.println(e1);
        System.out.println(f1);
    }
}
